//
// Created by Soar Qin on 2017/8/25.
// Copyright (c) 2017 Soar Qin. All rights reserved.
//

#pragma once

#include "io_event.hh"

namespace core::async {

class Signal: public IoEvent {
    DISABLE_CLASS_COPY(Signal);
public:
    using IoEvent::IoEvent;
    bool start(int sig);
    void enable(bool on);

protected:
    virtual void onSignal() = 0;

private:
    void onEvent(short events) override;
};

}
